package priv.yiyuan.example.design.wrapper;

/**
 * 信用卡支付
 * <p>
 * 策略模式-具体策略
 * 装饰器模式-具体组件
 *
 * @author YiYuan
 * @data 2025/9/2
 * @apoNote
 */
public class CreditCardPayment implements PaymentStrategy {

    private String cardNumber;

    public CreditCardPayment(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    @Override
    public void pay(double amount) {
        System.out.println("使用信用卡 " + cardNumber + " 支付 " + amount + " 元。");
    }

    @Override
    public String getDescription() {
        return "信用卡支付";
    }
}
